((typeof self !== 'undefined' ? self : this)["webpackJsonpproduct_manager"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpproduct_manager"] || []).push([[28],{

/***/ "3f8a":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
var es_symbol = __webpack_require__("a4d3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.keys.js
var es_object_keys = __webpack_require__("b64b");

// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js

function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js


function _objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = _objectWithoutPropertiesLoose(source, excluded);
  var key, i;

  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);

    for (i = 0; i < sourceSymbolKeys.length; i++) {
      key = sourceSymbolKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
      target[key] = source[key];
    }
  }

  return target;
}
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
var es_regexp_exec = __webpack_require__("ac1f");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.split.js
var es_string_split = __webpack_require__("1276");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.starts-with.js
var es_string_starts_with = __webpack_require__("2ca0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.trim.js
var es_string_trim = __webpack_require__("498a");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.iterator.js
var es_array_iterator = __webpack_require__("e260");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.iterator.js
var es_string_iterator = __webpack_require__("3ca3");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom-collections.iterator.js
var web_dom_collections_iterator = __webpack_require__("ddb0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url.js
var web_url = __webpack_require__("2b3d");

// EXTERNAL MODULE: ./node_modules/quasar-framework/dist/quasar.mat.esm.js
var quasar_mat_esm = __webpack_require__("e083");

// CONCATENATED MODULE: ./src/plugins/vueMixin.ts











/**
 * httpMixin全局混入
 * 如果需要则取消下面的注释以及最下一行的注释（同时取消types/main.d.ts的关于http的类型的注释）
 * 但是不建议使用全局混入
 * 可能存在同名以及浪费性能等未知风险
 */
// import HttpMixin from '@/mixins/httpMixin'

/* harmony default export */ var vueMixin = __webpack_exports__["default"] = (function (_ref) {
  var Vue = _ref.Vue;
  Vue.mixin({
    //  添加vue支持的属性及方法( methods | components | directives | created | mounted .....)
    //  !!!强烈不建议在这里声明vue生命周期钩子(因为在每个组件中执行)
    methods: {
      goBack: function goBack() {
        this.$router.go(-1);
      },
      _isValid: function _isValid(obj, propName) {
        if (obj === null || obj === undefined) {
          return false;
        } // Object or Array


        if (obj instanceof Object) {
          return propName ? propName in obj : true;
        } else if (obj instanceof Array) {
          return !!obj.length;
        } else {
          // 这里返回true(包含了 obj === 0 的情况)
          return true;
        }
      },
      showNotify: function showNotify(config) {
        !('timeout' in config) && (config.timeout = 1000);
        !('position' in config) && (config.position = 'bottom');
        !('color' in config) && (config.color = 'grey');
        quasar_mat_esm["c" /* Notify */].create(config);
      },
      showNotifyByCode: function showNotifyByCode() {
        var notifyConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
          code: 'success'
        };

        var _ref2 = notifyConfig || {},
            code = _ref2.code,
            config = _objectWithoutProperties(_ref2, ["code"]);

        !('timeout' in config) && (config.timeout = 2000);
        !('position' in config) && (config.position = 'bottom');

        if (code === 'success') {
          config.color = 'green';
          config.message = '操作成功！';
        } else if (code === 'fail') {
          config.color = 'red';
          !config.message && (config.message = '操作失败！');
        } else {
          !config.color && (config.color = 'grey');
        }

        quasar_mat_esm["c" /* Notify */].create(config);
      },
      responseValidate: function responseValidate(response) {
        if (response.code === 'fail') {
          if ('showNotify' in this) {
            this.showNotify({
              message: 'request failed: ' + response.info,
              position: 'center',
              color: 'red'
            });
          }

          return false;
        }

        return true;
      },
      download: function download(response) {
        if (!response) {
          return;
        }

        var fileName = 'test.txt';

        if ('headers' in response && 'content-disposition' in response.headers && response.headers['content-disposition'].indexOf('filename') > -1) {
          var header = response.headers['content-disposition'].split(';');

          for (var i = 0; i < header.length; i++) {
            if (header[i].trim().startsWith('filename')) {
              var arr = header[i].split('=');
              fileName = arr[arr.length - 1].trim();
              break;
            }
          }
        }

        var url = window.URL.createObjectURL(new Blob([response.data]));
        var link = document.createElement('a');
        link.style.display = 'none';
        link.href = url;
        link.setAttribute('download', decodeURI(fileName));
        link.click();
      }
    }
  }); // Vue.mixin(HttpMixin)
});
/*
* 以上所有方法在组件中直接调用, 都不需要import, 因为它们已注册到每个组件
*
* 例如:
*   this.responseValidate(response)
*
* */

/***/ })

}]);